<template>
  <div>
    <el-upload
      class="upload-demo"
      action="https://jsonplaceholder.typicode.com/posts/"
      :on-change="handleChange"
      :file-list="fileList"
      :on-preview="handleFile"
    >
      <el-button size="small" type="primary">点击上传</el-button>
      <div slot="tip" class="el-upload__tip">请上传附件</div>
    </el-upload>
  </div>
</template>

<script>
export default {
  data() {
    return {
      
    }
  },
  methods: {
    //点击文件名得回调
    handleFile(file){
      console.log(file)
    }
  },
}
</script>

<style></style>
